package com.zhf.dao.impl;

import com.zhf.dao.ArticleDao;
import com.zhf.domain.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class ArticleDaoImpl implements ArticleDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    /**
     * 新增文章
     * @param article
     * @return
     */
    public void addArticle(Article article) {
        String sql = "insert into t_article values(null,?,?)";
        int update = jdbcTemplate.update(sql, article.getTitle(), article.getContent());

    }
}
